home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / MOVIES / MOVIES.DIR / 00049_Script_49 < prev    next >
Text File  |  1995-11-15  |  15KB  |  581 lines

  1. on showHilite
  2.   global gCurrChan,gFirsChan,gLastChan,gMovieButtons,gPrevHilite
  3.   
  4.   put getAprop(gMovieButtons,gCurrChan) into thisOne
  5.   
  6.   goMovieGo
  7.   
  8.   set m = the movie
  9.   testOverheadMenu
  10.   if m <> the movie then exit
  11.   
  12.   updateController
  13.   
  14.   if (the visibility of sprite gCurrChan = 1) and rollOver(gCurrChan) then
  15.     put the puppet of sprite gCurrChan into pState
  16.     puppetSprite gCurrChan,false
  17.     put the castnum of sprite gCurrChan into it
  18.     set the puppet of sprite gCurrChan to pState
  19.     goMovieGo
  20.     if (it<>0) then
  21.       if gCurrChan <> gPrevHilite then
  22.         goMovieGo
  23.         rollo(thisOne)
  24.         put gCurrChan into gPrevHilite
  25.       end if
  26.       goMovieGo
  27.       if the mouseDown then
  28.         goMovieGo
  29.         
  30.         --        set n = the castNum of sprite gCurrChan
  31.         --        if n <> -1 then
  32.         --          set n = the name of cast n
  33.         --          if n = "MCR.PIC" or n = "MTR.PIC" then exit
  34.         --        end if
  35.         
  36.         press(thisOne)
  37.         put 0 into gPrevHilite
  38.         goMovieGo
  39.         if rollover(gCurrChan) then
  40.           goMovieGo
  41.           set m = the movie
  42.           doScript(thisOne)
  43.           if m <> the movie then exit
  44.           goMovieGo
  45.           norm(thisOne)
  46.           if gCurrChan < 5 then
  47.             repeat while the mouseDown
  48.               goMovieGo
  49.             end repeat
  50.           end if
  51.         end if
  52.       end if
  53.     else
  54.       if gCurrChan = 4 and rollOver(2) then set gCurrChan = 2
  55.       if gCurrChan <> gFirsChan and rollOver(gCurrChan - 1) then 
  56.         put "backward"
  57.         set gCurrChan = gCurrChan - 1
  58.       else
  59.         
  60.         put gCurrChan+1 into gCurrChan
  61.         if gCurrChan > gLastChan then put gFirsChan into gCurrChan
  62.       end if
  63.       
  64.     end if
  65.   else
  66.     goMovieGo
  67.     if gCurrChan = gPrevHilite then norm(thisOne)
  68.     put 0 into gPrevHilite
  69.     if gCurrChan = 4 and rollOver(2) then 
  70.       set gCurrChan = 2
  71.       put "set special"
  72.       put gCurrChan && gFirsChan
  73.     end if
  74.     
  75.     if gCurrChan <> gFirsChan and rollOver(gCurrChan - 1) then 
  76.       --put "2backward"
  77.       set gCurrChan = gCurrChan - 1
  78.       
  79.     else
  80.       put gCurrChan+1 into gCurrChan
  81.       if gCurrChan > gLastChan then put gFirsChan into gCurrChan
  82.     end if
  83.     
  84.   end if
  85.   goMovieGo
  86. end showHilite
  87.  
  88. on showHilitexxx
  89.   global gCurrChan,gFirsChan,gLastChan,gMovieButtons,gPrevHilite
  90.   
  91.   put getAprop(gMovieButtons,gCurrChan) into thisOne
  92.   
  93.   testOverheadMenu
  94.   
  95.   goMovieGo
  96.   if (the visibility of sprite gCurrChan = 1) and rollOver(gCurrChan) then
  97.     goMovieGo
  98.     put the puppet of sprite gCurrChan into pState
  99.     puppetSprite gCurrChan,false
  100.     put the castnum of sprite gCurrChan into it
  101.     set the puppet of sprite gCurrChan to pState
  102.     goMovieGo
  103.     if (it<>0) then
  104.       goMovieGo
  105.       if gCurrChan <> gPrevHilite then
  106.         rollo(thisOne)
  107.         put gCurrChan into gPrevHilite
  108.       end if
  109.       goMovieGo
  110.       if the mouseDown then
  111.         goMovieGo
  112.         press(thisOne)
  113.         set n = the castNum of sprite gCurrChan
  114.         if n <> -1 then
  115.           set n = the name of cast n
  116.           if n = "MCR.PIC" or n = "MTR.PIC" then exit
  117.         end if
  118.         
  119.         put 0 into gPrevHilite
  120.         goMovieGo
  121.         if rollover(gCurrChan) then
  122.           goMovieGo
  123.           doScript(thisOne)
  124.           goMovieGo
  125.           norm(thisOne)
  126.         end if
  127.         goMovieGo
  128.       end if
  129.     else
  130.       if gCurrChan = 4 and rollOver(2) then set gCurrChan = 2
  131.       if gCurrChan <> gFirsChan and rollOver(gCurrChan - 1) then 
  132.         put "backward"
  133.         set gCurrChan = gCurrChan - 1
  134.       else
  135.         
  136.         put gCurrChan+1 into gCurrChan
  137.         if gCurrChan > gLastChan then put gFirsChan into gCurrChan
  138.       end if
  139.       
  140.     end if
  141.     goMovieGo
  142.   else
  143.     goMovieGo
  144.     if gCurrChan = gPrevHilite then norm(thisOne)
  145.     put 0 into gPrevHilite
  146.     if gCurrChan = 4 and rollOver(2) then 
  147.       set gCurrChan = 2
  148.       put "set special"
  149.       put gCurrChan && gFirsChan
  150.     end if
  151.     
  152.     if gCurrChan <> gFirsChan and rollOver(gCurrChan - 1) then 
  153.       --put "2backward"
  154.       set gCurrChan = gCurrChan - 1
  155.       
  156.     else
  157.       put gCurrChan+1 into gCurrChan
  158.       if gCurrChan > gLastChan then put gFirsChan into gCurrChan
  159.     end if
  160.     
  161.   end if
  162.   goMovieGo
  163. end showHilite
  164.  
  165. on large
  166.   global gMovieLabel, gCurLabelProp
  167.   
  168.   set gMovieLabel = (char 1 to 2 of gMovieLabel)&"L"
  169.   if gMovieLabel = "COL" then set gMovieLabel = "COL"
  170.   set gCurLabelProp = gMovieLabel
  171.   
  172.   size "large"
  173. end
  174.  
  175. --
  176. --
  177. -- bug in director, only small needs this fix...
  178. --
  179. on small
  180.   global gMovieLabel, gCurLabelProp
  181.   --
  182.   --
  183.   -- Check for lower case "cos"
  184.   --
  185.   set gMovieLabel = (char 1 to 2 of gMovieLabel)&"S"
  186.   
  187.   if gMovieLabel = "cos" then set gMovieLabel = "cos"
  188.   set gCurLabelProp = gMovieLabel
  189.   
  190.   size "small"
  191. end
  192.  
  193. on size whichWay
  194.   if the framelabel <> "" then 
  195.     if whichWay = "large" then go next 
  196.     else go previous
  197.   else
  198.     if whichWay ="small" then
  199.       goSmaller
  200.     else goBigger
  201.   end if
  202. end size
  203.  
  204.  
  205.  
  206. on controller
  207.   global gMovieIsPlaying
  208.   
  209.   if not gMovieIsPlaying then playMovie
  210.   
  211.   if the visible of sprite 14 then
  212.     puppetSprite 15,0
  213.     set the visible of sprite 14 = 0
  214.     set the visible of sprite 15 = 0
  215.   else  
  216.     puppetSprite 15,1
  217.     set the visible of sprite 14 = 1
  218.     set the visible of sprite 15 = 1
  219.   end if
  220. end controller
  221.  
  222. on updateController
  223.   
  224.   if the type of sprite 12 <> 16 then exit
  225.   
  226.   set s = the stopTime of sprite 12
  227.   set w = the width of sprite 12
  228.   set p = the movieTime of sprite 12
  229.   set r = the right of sprite 12
  230.   
  231.   set h = r-(w-(p*w)/s)
  232.   
  233.   set the locH of sprite 15 = h
  234. end updateController
  235.  
  236. on setController onOff
  237.   if onOff then
  238.     if the visible of sprite 14 then
  239.       puppetSprite 15,1  
  240.       updateController
  241.       set the visibility of sprite 15 = 1  
  242.     end if
  243.   else
  244.     puppetSprite 15, 0
  245.     set the visibility of sprite 14 = 0
  246.     set the visibility of sprite 15 = 0
  247.     updateStage  
  248.   end if
  249.   
  250. end setController
  251.  
  252.  
  253.  
  254. on goSmaller
  255.   global gMovieLabel, gMovieIsPlaying
  256.   --put ">>>" & gMovieLabel
  257.   --
  258.   --
  259.   -- Check for lower case "cos"
  260.   --
  261.   
  262.   set gMovieLabel = (char 1 to 2 of gMovieLabel)&"S"
  263.   
  264.   if gMovieLabel = "cos" then set gMovieLabel = "cos"
  265.   
  266.   --put ">>>" & gMovieLabel
  267.   put (label(gMovieLabel)) into frameNumber
  268.   puppetSprite 15, 0
  269.   set the visibility of sprite 15 = 0
  270.   go frame frameNumber+1
  271.   setController 1
  272.   updateStage
  273. end
  274.  
  275. on goBigger
  276.   global gMovieLabel, gMovieIsPlaying
  277.   --put ">>>" & gMovieLabel
  278.   set gMovieLabel = (char 1 to 2 of gMovieLabel)&"L"
  279.   --put ">>>" & gMovieLabel
  280.   put (label(gMovieLabel)) into frameNumber
  281.   puppetSprite 15, 0
  282.   set the visibility of sprite 15 = 0
  283.   go frame frameNumber+1
  284.   setController 1
  285.   updateStage
  286. end
  287.  
  288. on testVisitLabels castName
  289.   global gLabels
  290.   
  291.   set hitList to value(field castName)
  292.   set c = count(hitList)
  293.   repeat with i = 1 to c
  294.     set theLabel = getAt(hitList, i) 
  295.     if theLabel = "" then next repeat
  296.     set list = getAProp(gLabels, theLabel)
  297.     put i && theLabel 
  298.     put getAt(list,1)
  299.   end repeat
  300.   
  301.   put "Done."
  302. end
  303.  
  304.  
  305. on lookUpTime curTime
  306.   global gMovieLabel
  307.   
  308.   set hitList to value(string(field(char 1 to 2 of gMovieLabel)))
  309.   set c = count(hitList)
  310.   repeat with i = 1 to c 
  311.     set t = getPropAt(hitList, i)  
  312.     if t > curTime then 
  313.       set theLabel = getAt(hitList, i)
  314.       exit repeat
  315.     end if
  316.   end repeat
  317.   
  318.   return theLabel
  319.   
  320. end lookUpTime
  321.  
  322. on visit
  323.   global gMovieLabel, gMovieTimeCO, gMovieTimeCR, gMovieTimeFO, gMovieTimeSP
  324.   --if gTourLabel = "EMS" then exit -- no links
  325.   
  326.   if the type of sprite 12 = 16 then
  327.     put  the movieTime of sprite 12 into curTime
  328.     do "set gMovieTime"&char 1 to 2 of gMovieLabel & " = curTime"
  329.   end if
  330.   
  331.   set theLabel = lookUpTime(curTime)
  332.   
  333.   if theLabel = "" then 
  334.     set the visibility of sprite 9 = 0
  335.     exit 
  336.   end if
  337.   
  338.   puppetSprite 15,0
  339.   goGo(theLabel)
  340.   --go frame theLabel of movie getAt(xList,2)
  341. end
  342.  
  343. on continue
  344.   playMovie
  345. end
  346.  
  347. on nextMovie
  348.   global gMovieLabel, gCurLabelProp
  349.   --puppetTransition 50,1,120,false
  350.   stopMovies
  351.   put char 1 to 2 of gMovieLabel into thisMovie
  352.   
  353.   put char 3 of gMovieLabel into thisSize
  354.   
  355.   if thisSize = "s" then set thisSize = "S"
  356.   
  357.   if thisMovie = "SP" then  put "co" into newMovie
  358.   else  if thisMovie = "co" then put "CR" into newMovie
  359.   else  if thisMovie = "CR" then put "FO" into newMovie
  360.   else  if thisMovie = "FO" then put "SP" into newMovie
  361.   
  362.   set gMovieLabel = newMovie&thisSize
  363.   
  364.   if gMovieLabel = "cos" then set gMovieLabel = "cos"
  365.   if gMovieLabel = "COL" then set gMovieLabel = "COL"
  366.   
  367.   addToRetrace
  368.   set the visible of sprite 9 = 0
  369.   set the visible of sprite 10 = 0
  370.   set gCurLabelProp = gMovieLabel
  371.   go frame gMovieLabel
  372.   patchPal
  373.   updateStage
  374. end nextMovie
  375.  
  376. on prevMovie
  377.   global gMovieLabel, gCurLabelProp
  378.   --puppetTransition 50,1,120,false
  379.   stopMovies
  380.   put char 1 to 2 of gMovieLabel into thisMovie
  381.   put char 3 of gMovieLabel into thisSize
  382.   
  383.   if thisSize = "s" then set thisSize = "S"
  384.   
  385.   if thisMovie = "co" then  put "SP" into newMovie
  386.   else  if thisMovie = "SP" then put "FO" into newMovie
  387.   else  if thisMovie = "FO" then put "CR" into newMovie
  388.   else  if thisMovie = "CR" then put "co" into newMovie
  389.   
  390.   
  391.   set gMovieLabel = newMovie&thisSize
  392.   
  393.   if gMovieLabel = "cos" then set gMovieLabel = "cos"
  394.   if gMovieLabel = "COL" then set gMovieLabel = "COL"
  395.   
  396.   addToRetrace
  397.   set the visible of sprite 9 = 0
  398.   set the visible of sprite 10 = 0
  399.   set gCurLabelProp = gMovieLabel
  400.   go frame gMovieLabel
  401.   patchPal
  402.   updateStage
  403. end prevMovie
  404.  
  405. on playMovie
  406.   global gMovieLabel,gMovieIsPlaying, gVolume
  407.   global gMovieTimeCO, gMovieTimeCR, gMovieTimeFO, gMovieTimeSP
  408.   
  409.   global gHelpOffScreen, gHelpPalette
  410.   
  411.   if not voidP(gHelpOffScreen) and not gHelpOffScreen then 
  412.     returnFromHelp
  413.     repeat while the mouseDown
  414.     end repeat
  415.     
  416.     exit
  417.   end if
  418.   
  419.   cursor 4
  420.   
  421.   put "M"&(char 1 to 2 of gMovieLabel)&".MOV" into preloadName
  422.   set cn = the number of cast preloadName
  423.   
  424.   set movieTime = 0
  425.   do "set movieTime = gMovieTime"&char 1 to 2 of gMovieLabel  
  426.   
  427.   set oldLabel = the frame
  428.   set newLabel = label(gMovieLabel)+1
  429.   
  430.   if oldLabel <> newLabel then
  431.     set the controller of cast cn = false
  432.     set the visible of sprite 14 = 0
  433.     set the visible of sprite 15 = 0
  434.   end if
  435.   
  436.   go frame newLabel
  437.   
  438.   if gMovieIsPlaying then
  439.     pauseMovie
  440.   else
  441.     set the visible of sprite 9 to false
  442.     set the visible of sprite 10 to false
  443.     set the visible of sprite 13 = false
  444.     --puppetSprite 12, true
  445.     
  446.     if not voidP(movieTime) then
  447.       set the movieTime of sprite 12 = movieTime
  448.       do "set gMovieTime"&char 1 to 2 of gMovieLabel & " = void"
  449.     end if
  450.     
  451.     
  452.     
  453.     set the volume of sprite 12 to gVolume
  454.     set the stopTime of sprite 12 to (the duration of cast preloadName)
  455.     updateStage
  456.     set the movieRate of sprite 12 to 1
  457.     put true into gMovieIsPlaying
  458.     updateStage
  459.   end if
  460.   
  461.   cursor -1
  462.   
  463. end playMovie
  464.  
  465. on pauseMovie noButtons, keepRandom
  466.   global gMovieLabel, gMovieIsPlaying, gRandomMovies
  467.   global gMovieTimeCO, gMovieTimeCR, gMovieTimeFO, gMovieTimeSP
  468.   
  469.   if voidP(keepRandom) then set keepRandom = 0
  470.   
  471.   if the type of sprite 12 = 16 then
  472.     if the movieTime of sprite 12 >= the stopTime of sprite 12 then set noButtons = 1
  473.   end if
  474.   
  475.   
  476.   if gMovieIsPlaying then
  477.     --puppetSprite 12,true
  478.     
  479.     if the type of sprite 12 = 16 then
  480.       repeat while the volume of sprite 12 > 0
  481.         set the volume of sprite 12 to (the volume of sprite 12)/2
  482.         updateStage
  483.         delay 8
  484.       end repeat
  485.       set the movieRate of sprite 12 to 0
  486.       set curTime = the movieTime of sprite 12
  487.       do "set gMovieTime" & char 1 to 2 of gMovieLabel & "= curTime"
  488.       set s = lookUpTime(curTime)
  489.       set the visible of sprite 9 = s <> "" and not noButtons
  490.       set the visible of sprite 10 to not noButtons
  491.     end if
  492.     
  493.     put false into gMovieIsPlaying
  494.     if not keepRandom then set gRandomMovies = 0
  495.   end if
  496. end pauseMovie
  497.  
  498. on stopMovies 
  499.   global gMovieLabel, gMovieIsPlaying
  500.   global gMovieTimeCO, gMovieTimeCR, gMovieTimeFO, gMovieTimeSP
  501.   
  502.   if the type of sprite 12 = 16 then
  503.     do "set gMovieTime" & char 1 to 2 of gMovieLabel & "= the movietime of sprite 12"
  504.   end if
  505.   
  506.   --  if gMovieIsPlaying then
  507.   if marker(0) <> the frame then
  508.     setController 0
  509.     set the visible of sprite 9 to false
  510.     set the visible of sprite 10 to false
  511.     repeat with i = 1 to 8
  512.       set the volume of sprite 12 to (the volume of sprite 12)-32
  513.       delay 8
  514.     end repeat
  515.     --set the directToStage of cast(the castNum of sprite 12) to false
  516.     set the controller of cast (the castNum of sprite 12) to false
  517.     set the movieRate of sprite 12 to 0
  518.     set the movieTime of sprite 12 to 0
  519.     
  520.     --puppetSprite 12, false
  521.     put "M"&(char 1 to 2 of gMovieLabel)&".MOV" into preloadName
  522.     repeat while true
  523.       unloadcast preloadName
  524.       if not(the loaded of cast preloadName) then exit repeat
  525.     end repeat
  526.     put false into gMovieIsPlaying
  527.     go to (the frame)-1
  528.   end if
  529. end stopMovies
  530.  
  531. on goMovieGo
  532.   global gMovieIsPlaying, gRandomMovies, gRanMovieIndex, gMovieLabel, gMovieList
  533.   global gMovieTimeCO, gMovieTimeCR, gMovieTimeFO, gMovieTimeSP
  534.   
  535.   --put ">>>goMovieGo"
  536.   
  537.   if the castNum of sprite 12 > 0 and the type of sprite 12 = 16 then
  538.     if the castType of cast the castnum of sprite 12 <> #digitalVideo then exit
  539.     if the movieRate of sprite 12 = 0 then 
  540.       
  541.       if gMovieIsPlaying then 
  542.         if the movieTime of sprite 12 >= the stopTime of sprite 12 then
  543.           setController 0
  544.           go to the frame - 1
  545.         end if
  546.         
  547.         pauseMovie(1,1)
  548.       end if  
  549.     else if not gMovieIsPlaying then 
  550.       playMovie
  551.     end if
  552.   else if gRandomMovies then
  553.     if gRanMovieIndex = 4 then
  554.       set gRanMovieIndex = 1
  555.     else
  556.       set gRanMovieIndex = gRanMovieIndex + 1
  557.     end if
  558.     
  559.     if char 3 of gMovieLabel <> "L" then
  560.       set gMovieLabel = getAt(gMovieList, gRanMovieIndex)
  561.     else
  562.       set gMovieLabel = char 1 to 2 of getAt(gMovieList, gRanMovieIndex) & "L"
  563.       if gMovieLabel = "COL" then set gMovieLabel = "COL"
  564.     end if
  565.     
  566.     set gCurLabelProp = gMovieLabel
  567.     
  568.     do "set gMovieTime"&char 1 to 2 of gMovieLabel & " = 0" 
  569.     
  570.     --puppetSprite 12, 0
  571.     
  572.     go frame (label(gMovieLabel)-1)
  573.     
  574.     puppetTransition 50,1,120,false
  575.     go next
  576.     patchpal
  577.     
  578.     playMovie
  579.   end if
  580.   
  581. end goMovieGo